class Solution {
public:
    vector<vector<int>> v;
    void dfs(int pos,vector<int>& ans,vector<int>& nums)
    {
        v.push_back(ans);

        for(int i=pos+1;i<nums.size();i++)
        {
            ans.push_back(nums[i]);
            dfs(i,ans,nums);
            ans.pop_back();
        }
    }
    vector<vector<int>> subsets(vector<int>& nums) {
        v.push_back(vector<int>());
        for(int i=0;i<nums.size();i++)
        {
            vector<int> ans;
            ans.push_back(nums[i]);
            dfs(i,ans,nums);
        }
        return v;
    }
};